package com.weitu.environmental.monitor.service.impl;

import com.weitu.environmental.monitor.entity.MonitoringInstrument;
import com.weitu.environmental.monitor.mapper.MonitoringInstrumentMapper;
import com.weitu.environmental.monitor.service.MonitoringInstrumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author zhangqingxi 2017-03-31
 */
@Service
public class MonitoringInstrumentServiceImpl implements MonitoringInstrumentService {

    private final MonitoringInstrumentMapper monitoringInstrumentMapper;

    @Autowired
    public MonitoringInstrumentServiceImpl(MonitoringInstrumentMapper monitoringInstrumentMapper) {
        this.monitoringInstrumentMapper = monitoringInstrumentMapper;
    }

    @Override
    public List<MonitoringInstrument> findByParam(Map paramMap) {
        return monitoringInstrumentMapper.findByParam(paramMap);
    }


    @Override
    public Integer findByParamCount(Map paramMap) {
        return monitoringInstrumentMapper.findByParamCount(paramMap);
    }

    @Override
    public MonitoringInstrument findById(String id) {
        return monitoringInstrumentMapper.findById(id);
    }

    @Transactional
    @Override
    public Integer add(Map paramMap) {

        return monitoringInstrumentMapper.add(paramMap);
    }

    @Transactional
    @Override
    public Integer updateById(Map paramMap) {

        return monitoringInstrumentMapper.updateById(paramMap);
    }


}
